package com.ruoyi.reim.service;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.reim.domain.WorkflowReimDetail;
import com.ruoyi.reim.mapper.WorkflowReimDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 报销审批明细Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-16
 */
@Service
public class WorkflowReimDetailService
{
    @Autowired
    private WorkflowReimDetailMapper workflowReimDetailMapper;

    /**
     * 查询报销审批明细
     *
     * @param id 报销审批明细ID
     * @return 报销审批明细
     */
    public WorkflowReimDetail selectWorkflowReimDetailById(Integer id)
    {
        return workflowReimDetailMapper.selectWorkflowReimDetailById(id);
    }

    /**
     * 查询报销审批明细列表
     *
     * @param workflowReimDetail 报销审批明细
     * @return 报销审批明细
     */
    public List<WorkflowReimDetail> selectWorkflowReimDetailList(WorkflowReimDetail workflowReimDetail)
    {
        return workflowReimDetailMapper.selectWorkflowReimDetailList(workflowReimDetail);
    }

    /**
     * 新增报销审批明细
     *
     * @param workflowReimDetail 报销审批明细
     * @return 结果
     */
    public int insertWorkflowReimDetail(WorkflowReimDetail workflowReimDetail)
    {
        workflowReimDetail.setCreateTime(DateUtils.getNowDate());
        return workflowReimDetailMapper.insertWorkflowReimDetail(workflowReimDetail);
    }

    /**
     * 修改报销审批明细
     *
     * @param workflowReimDetail 报销审批明细
     * @return 结果
     */
    public int updateWorkflowReimDetail(WorkflowReimDetail workflowReimDetail)
    {
        workflowReimDetail.setUpdateTime(DateUtils.getNowDate());
        return workflowReimDetailMapper.updateWorkflowReimDetail(workflowReimDetail);
    }

    /**
     * 批量删除报销审批明细
     *
     * @param ids 需要删除的报销审批明细ID
     * @return 结果
     */
    public int deleteWorkflowReimDetailByIds(Integer[] ids)
    {
        return workflowReimDetailMapper.deleteWorkflowReimDetailByIds(ids);
    }

    /**
     * 删除报销审批明细信息
     *
     * @param id 报销审批明细ID
     * @return 结果
     */
    public int deleteWorkflowReimDetailById(Integer id)
    {
        return workflowReimDetailMapper.deleteWorkflowReimDetailById(id);
    }

    public int saveList(List<WorkflowReimDetail> list){
        return workflowReimDetailMapper.saveList(list);
    }
}
